<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<meta content="black" name="apple-mobile-web-app-status-bar-style" />
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=no">
    <title>工作流列表  - {$cwgl_config['webtitle']}</title>
	<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <link href="{$templateurl}/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="{$templateurl}/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="{$templateurl}/css/animate.css" rel="stylesheet">
    <link href="{$templateurl}/css/style.css?v=4.1.0" rel="stylesheet">
	<link href="{$templateurl}/css/css.css" rel="stylesheet" type="text/css">
	<link href="{$templateurl}/css/common.css" rel="stylesheet" type="text/css">

</head>

<body class="gray-bg">
	<div class="head">
		<div class="content-top clearFix">
			<a href="{php echo $this->createMobileUrl('staff_index')}">
			<em class="return"><</em>
			<span class="fanhui">返回</span>
			</a>
		</div>
	</div>
    <div class="wrapper wrapper-content animated fadeInUp">
        <div class="row">
            <div class="col-sm-12">

                <div class="ibox">
                    <div class="ibox-title">
                        <h5>所有工作流</h5>
                        <div class="ibox-tools">
                            <a href="{php echo $this->createMobileUrl('staff_workflow',array('op' => 'edit'))}" class="btn btn-primary btn-xs">创建新项目</a>
                        </div>
                    </div>
                    <div class="ibox-content">

                        <div class="project-list">

                            <table class="table table-hover">
                                <tbody>
                                    {loop $workflows $key $value}
									<tr>
                                        <td class="project-status">
                                            {if $value['step']>4}
                                            <span class="label label-primary">已完成</span>
                                            {elseif $value['step']==-1}
                                            <span class="label label-warning">失败</span>
                                            {else}
                                            <span class="label label-success">进行中</span>
                                            {/if}
                                        </td>
                                        <td class="project-title">
                                            <a>业务申请-{$value['id']}</a>
                                            <br/>
                                            <small>创建于 {$value['st1_create_time']}</small>
											<br/>
											<small>当前进度:
                                                {php $stepTemp=array(1=>'步骤一',2=>'步骤二',3=>'步骤三',4=>'步骤四',5=>'完成');echo $stepTemp[$value['step']];}
                                                -{$value['curStaff']}</small>
											<div class="progress progress-mini">
                                                    <div style="width: {php echo ($value['step']-1)/4*100 }%;" class="progress-bar" ></div>
                                                </div>
                                        </td>
                                        <td class="project-actions">
											<a href="{php echo $this->createMobileUrl('staff_workflow', array('op' => 'detail','id' => $value['id']))}" class="btn btn-white btn-sm"><i class="fa fa-folder"></i> 查看 </a>
                                            {if  !empty($value['isEdit'])}
                                            <a href="{php echo $this->createMobileUrl('staff_workflow', array('op' => 'edit','id' => $value['id']))}" class="btn btn-white btn-sm"><i class="fa fa-pencil"></i> 编辑 </a>
                                            {/if}
                                        </td>
                                    </tr>
									{/loop}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    <!-- 全局js -->
    <script src="{$templateurl}/js/jquery.min.js?v=2.1.4"></script>
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

    <script>
        $(document).ready(function(){

            $('#loading-example-btn').click(function () {
                btn = $(this);
                simpleLoad(btn, true)

                // Ajax example
//                $.ajax().always(function () {
//                    simpleLoad($(this), false)
//                });

                simpleLoad(btn, false)
            });
        });

        function simpleLoad(btn, state) {
            if (state) {
                btn.children().addClass('fa-spin');
                btn.contents().last().replaceWith(" Loading");
            } else {
                setTimeout(function () {
                    btn.children().removeClass('fa-spin');
                    btn.contents().last().replaceWith(" Refresh");
                }, 2000);
            }
        }
    </script>

	<!--footer star-->
	<br><br>
	<div class="navbar-fixed-bottom">{template 'staff_footer'}</div>
</body>
</html>
